﻿<%@ Page Title="" Language="C#" MasterPageFile="/Common/Master.master" %>

<script runat="server">

</script>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentForm" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentHtml" runat="Server">
    <div id="toolBar" style="display: none;">
        <div id="toolbarAdd" style="display: none;" data-options="iconCls:'icon-table_add',plain:'true'" class="easyui-linkbutton" onclick="$.fn.DataGrid.Insert(obj)">添加</div>
        <div id="toolbarEdit" style="display: none;" data-options="iconCls:'icon-table_edit',plain:'true'" class="easyui-linkbutton" onclick="$.fn.DataGrid.Update(obj)">修改</div>
        <div id="toolbarDelete" style="display: none;" data-options="iconCls:'icon-table_delete',plain:'true'" class="easyui-linkbutton" onclick="$.fn.DataGrid.Delete(obj)">删除</div>
        <div id="toolbarBmgl" data-options="iconCls:'icon-table',plain:'true'" class="easyui-linkbutton" onclick="Bmgl()">位置设置</div>
        <div id="toolbarSearchtext"></div>
    </div>
    <div id="page"></div>
    <table id="dg1" style="display: none;">
        <thead>
            <tr>
                <th data-options="field: 'city',width: 150">城市</th>
                <th data-options="field: 'Name',width: 150">项目名称</th>
                <th data-options="field: 'mangerUserID',width: 150">项目负责人</th>
                <th data-options="field: 'address',width: 150">详细地址</th>
                <th data-options="field: 'remark',width: 150">备注</th>
                <th data-options="field: 'longitude',width: 150">位置经度</th>
                <th data-options="field: 'latitude',width: 150">位置维度</th>
                <th data-options="field: 'status',width: 150">项目状态</th>
                <th data-options="field: 'AddUserID',width: 150">创建人</th>
                <th data-options="field: 'AddTime',width: 150,formatter:function(val,rec){ return $.DateFormat(val, 'yyyy-MM-dd HH:mm:ss'); }">创建时间</th>
                <th data-options="field: 'LastTime',width: 150,formatter:function(val,rec){ return $.DateFormat(val, 'yyyy-MM-dd HH:mm:ss'); }">上次修改时间</th>
                <th data-options="field: 'LastUserId',width: 150">上次修改人</th>
            </tr>
        </thead>
    </table>

    <script type="text/javascript">
        var obj;
        $(function () {
            obj = {
                id: "dg1",
                key: "ID",
                url: "Api/V1/dd_project/GetPagesproject",
                deleteUrl: "Api/V1/dd_project/Deleteproject",
                data: {},

                //title: "项目管理管理",
                dialogName: "项目管理管理",
                dialogWidth: Cookies.get('DialogWidth') + "px",
                dialogHeight: Cookies.get('DialogHeight') + "px",
                editUrl: "/DingDing/dd_project/edit.aspx",
                detailsUrl: "/DingDing/dd_project/details.aspx",
                toolBar: '#toolBar',
                footer: '#page',
                callback: function () { $.fn.DataGrid.onRefresh(obj); }
            };
            $.fn.DataGrid.DataBind(obj);

            obj.mapCallback = function (ret) {
                debugger
            }
        });

        function Bmgl() {
            var row = $('#dg1').datagrid('getSelected');
            if (row != null) {
                var _url = "/common/map.html?CompanyID=" + row[obj.key];
                _url = "/common/map.html?Longitude=" + row["longitude"] + "&Latitude=" + row["latitude"] + "&Address=" + escape(row["address"]);
                $.layerOpen({ "用户管理": "用户管理", width: '80%', height: '80%', url: _url, callback: obj.mapCallback });
            } else {
                $.messager.alert('提示信息', '您还没有选择任何记录！', 'info');
            }
        }
        function XuanDian() {
            var url = "/common/map.html?Longitude=" + $.GetValue("Longitude") + "&Latitude=" + $.GetValue("Latitude") + "&Address=" + escape($.GetValue("Address"));
            $.DialogOpen("", "地图设置", $.cookie('DialogWidth') + "px", $.cookie('DialogHeight') + "px", url, function (data) {
                $("#Longitude").val(data.Longitude);
                $("#Latitude").val(data.Latitude);
                $("#Adresse").val(data.Address);
            });
        }
    </script>
</asp:Content>

